package com.baylor.server.business.utils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.baylor.server.business.entity.Admin;

public class LangHelper {
	/**
	 * 获取当前语言类型
	 * @param request
	 * @return
	 */
	public static String getLang(HttpServletRequest request) {
		String zhOrEn = "1";
		HttpSession session = request.getSession();
		if(session!=null)
		{
			Admin admin = (Admin) session.getAttribute("admin");
			
			if (admin != null) {
				zhOrEn = ("en".equals(admin.getLang())) ? "2" : "1";

			}
		} 
		return zhOrEn;
	}
	

}
